

<?php
if(LOCALHOST) {
    $ref = isset($_GET['ref']) ? $_GET['ref'] : GLOBAL_URL.substr($_SERVER['PHP_SELF'],1).'?'.$_SERVER['QUERY_STRING'];
} else {
    $ref = isset($_GET['ref']) ? $_GET['ref'] : ADMINER_URL.'index.php'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
}

include_once 'inc_modules_path.php'; ?>
<form class="form-inline" action="<?php echo site_urlc($this->class.'/index/'.$this->cid); ?>" method="GET">
    <?php
    if ($ctype = list_coltypes($this->cid,0,'ctype')) {
        if (isset($_GET['ctype']) AND is_numeric($_GET['ctype']) AND $_GET['ctype']) {
            echo ui_btn_select('ctype',set_value("ctype",$_GET['ctype']),$ctype);
        }else{
            echo ui_btn_select('ctype',set_value("ctype"),$ctype);
        }
    }
    ?>
    <span>姓名:</span>
    <input type="text" class="" name="uname"
           value="<?php echo $this->input->get('uname') ?>">
    <input class="btn" type="submit" value="检索">
    <a href="<?php echo site_urlc('coltypes/index/').'&field=ctype&rc='.$this->class; ?>" class="btn">分类管理</a><span>未处理数<?php echo $total?></span>
</form>
<p></p>
<div class="boxed">
    <div class="boxed-inner seamless">

<table class="table table-striped table-hover select-list">
    <thead>
        <tr>
            <th class="width-small"><input id='selectbox-all' type="checkbox" > </th>
            <th>举报人</th>
            <th>被举报人</th>
            <th>举报内容</th>
            <th>举报时间</th>
            <th>处理状态</th>
            <th class="span1">操作</th>
        </tr>
    </thead>
    <tbody class="sort-list">
        <?php foreach ($list as $v):?>
        <tr data-id="<?php echo $v['id'] ?>" data-sort="<?php echo $v['sort_id'] ?>">
            <td><input class="select-it" type="checkbox" value="<?php echo $v['id']; ?>" ></td>
            <td>
                <?php echo $v['uname'].'('.$v['phone'].')'?>
             </td>
            <td> <?php echo $v['runame'].'('.$v['rphone'].')' ?></td>
            <td> <?php echo  $v['content']; ?> </td>
            <td> <?php echo  date("Y/m/d H:i:s",$v['timeline']); ?> </td>
            <td> <?php echo  $v['status'] ? '已处理' : '未处理'; ?> </td>
            <td>
                <div class="btn-group">
                    <?php if(!$v['status']) {?>
                        <a class='btn btn-small' href=" <?php echo site_url( $this->router->class.'/one/'.$this->cid.'?id='.$v['id'].'&status=1'.'&ref='.base64_encode($ref)) ?> "> 已处理 </a>
                    <?php }?>
                </div>
            </td>
        </tr>
        <?php endforeach;?>
    </tbody>
</table>

    </div>
</div>


<?php echo $pages; ?>

<script>
require(['adminer/js/ui'],function(ui){
  var report = {
    url_del: "<?php echo site_urlc('report/delete'); ?>"
    ,url_audit: "<?php echo site_urlc('report/audit'); ?>"
    ,url_flag: "<?php echo site_urlc('report/flag'); ?>"
//    ,url_sortid: "<?php //echo site_urlc('report/sortid'); ?>//"
  };

  ui.fancybox_img();
  ui.btn_delete(report.url_del);     // 删除
  ui.btn_audit(report.url_audit);    // 审核
  ui.btn_flag(report.url_flag);      // 推荐
//  ui.sortable(report.url_sortid);    // 排序
});
</script>
